package com.zznj.xzjc.net.rxjava;

import com.zznj.xzjc.application.APP;
import com.zznj.xzjc.net.SharedHelper;
import com.zznj.xzjc.net.entity.BaseBean;
import com.zznj.xzjc.net.progress.HttpInterceptor;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;

import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class HttpMethods {
    public static final String QN_PATH = "http://218.28.192.34:9001/";
    public static final String ACCESS_KEY = "HediAYr7J18nGa63jaDYGb_rJ6hsMseShsW5xLAF";
    public static final String SECRET_KEY = "mPWwkC21rVqO0VvBAwFvKBmbnULHv_JlvxEbchFv";
    public static final String BASE_URL = "http://218.28.192.34:9001/";
    public static final String BASE_IMG_URL = "http://218.28.192.34:9001/";
    public static final String VERSION_URL = "http://218.28.192.34:9001/download/appFile4Xzjc";
    public static final String BASE_File_URL = "http://218.28.192.34:9001/xzapi/system/attachDownLoad?fileId=";
    public static final String BASE_BAZN_URL = "http://218.28.192.34:9001/caseGuide/getCaseGuide.ht?clueDomain=";
    public static final String BASE_TJFX_URL = "http://218.28.192.34:9001/statisticalAnalysis/getStatisticalAnalysis.ht?orgId=";
    public static final String BASE_WORK_URL = "http://218.28.192.34:9001/knowledge/getKnowledgeBase.ht?id=";
    public static final String SHARE_TITLE = "萤火";
    public static final String SHARE_DESC = "萤火";
    public static final String SHARE_URL = "http://www.nbninikeji.com/downApk.client";
    public static final boolean isSuccess = false;
    private static final int DEFAULT_TIMEOUT = 30;
    private Retrofit retrofit;
    private APIService apiService;
    private final HashMap<String, List<Cookie>> cookieStore = new HashMap<>();
    //构造方法私有
    private HttpMethods() {
        //手动创建一个OkHttpClient并设置超时时间
        //声明日志类
        HttpInterceptor httpLoggingInterceptor = new HttpInterceptor();
        //设定日志级别
        httpLoggingInterceptor.setLevel(HttpInterceptor.Level.BODY);
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        builder.connectTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS).
                readTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS).
                addInterceptor(httpLoggingInterceptor).
                writeTimeout(DEFAULT_TIMEOUT, TimeUnit.SECONDS);
        OkHttpClient okHttpClient = builder.cookieJar(new CookieJar() {
            @Override
            public void saveFromResponse(HttpUrl httpUrl, List<Cookie> list) {
                if(httpUrl.url().getPath().contains("login")){
                    cookieStore.put(httpUrl.host(), list);
                }
            }

            @Override
            public List<Cookie> loadForRequest(HttpUrl httpUrl) {
                List<Cookie> cookies = cookieStore.get(httpUrl.host());
                return cookies != null ? cookies : new ArrayList<Cookie>();
            }
        }).build();
        retrofit = new Retrofit.Builder()
                .client(okHttpClient)
                .addConverterFactory(ResponseConvertFactory.create())
                .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
                .baseUrl(BASE_URL)
                .build();

        apiService = retrofit.create(APIService.class);
    }

    private String getCookie(){
        String cookie = SharedHelper.readValueByKeyForString(APP.getInstance().getApplicationContext(),"cookie");
        return cookie;
    }

    //获取单例
    public static HttpMethods getInstance() {
        return SingletonHolder.INSTANCE;
    }

    /**
     * 登录
     */
    public void login(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.login(requestBody));
    }

    /**
     * 获取最新线索
     */
    public void getIndexZuiXinXianSuo(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getIndexZuiXinXianSuo(getCookie(),requestBody));
    }

    /**
     * 获取工作动态，案例播放
     */
    public void getIndexWorkAndAnLi(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getIndexWorkAndAnLi(getCookie(),requestBody));
    }

    /**
     * 获取线索发现的字典列表
     */
    public void getFindXianSuoDictionary(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getFindXianSuoDictionary(getCookie(),requestBody));
    }

    /**
     * /webapi/knowledge/getLawSubjectByOrgName.ht
     * @param subscriber
     * @param requestBody
     */
    public void getLawSubjectByOrgName(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getLawSubjectByOrgName(getCookie(),requestBody));
    }



    /**
     * 保存上传文件信息 POST /webapi/ourClue/evidenceMaterialSave.ht
     */
    public void evidenceMaterialSave(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.evidenceMaterialSave(getCookie(),requestBody));
    }

    /**
     * 保存上传文件信息 POST /webapi/sysFile/getHttpUrlById.ht
     */
    public void getHttpUrlById(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getHttpUrlById(getCookie(),requestBody));
    }

    /**
     * 获取线索发现的字典列表
     */
    public void uploadFile(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.uploadFile(getCookie(),requestBody));
    }

    /**
     * 线索第二頁
     */
    public void getFindXianSuoList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getFindXianSuoList(getCookie(),requestBody));
    }

    /**
     * 意见反馈 POST xzapi/system/addSysFeedback
     */
    public void addSysFeedback(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.addSysFeedback(getCookie(),requestBody));
    }

    /**
     * 行政处罚
     */
    public void casePenaltyGet(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.casePenaltyGet(getCookie(),requestBody));
    }

    /**
     * 行政处罚
     */
    public void crimeCaseGet(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.crimeCaseGet(getCookie(),requestBody));
    }

    /**
     * 行政处罚
     */
    public void complaintsReportGet(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.complaintsReportGet(getCookie(),requestBody));
    }

    /**
     * 市长热线
     */
    public void leaderHotlineGet(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.leaderHotlineGet(getCookie(),requestBody));
    }

    /**
     * 获取刑事判决案件详情
     */
    public void caseJudgmentGet(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.caseJudgmentGet(getCookie(),requestBody));
    }

    /**
     * 案源详情--网路舆情 POST /webapi/caseSource/publicOpinionGet.ht
     */
    public void publicOpinionGet(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.publicOpinionGet(getCookie(),requestBody));
    }

    /**
     * 保存受理 POST /webapi/ourClue/ourClueSave.ht
     */
    public void ourClueSave(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.ourClueSave(getCookie(),requestBody));
    }

    /**
     * 保存受理 POST /webapi/ourClue/distribute.ht
     */
    public void distribute(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.distribute(getCookie(),requestBody));
    }

    /**
     * 不予受理 POST /webapi/ourClue/caseJudgeNotDealSave.ht
     */
    public void caseJudgeNotDealSave(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.caseJudgeNotDealSave(getCookie(), requestBody));
    }

    /**
     * 案源详情--网路舆情 POST knowledge/get.ht
     */
    public void knowledgeGet(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.knowledgeGet(getCookie(),requestBody));
    }

    /**
     * 获取执法单位列表 lawSubjectSelector.ht
     */
    public void lawSubjectSelector(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.lawSubjectSelector(getCookie(),requestBody));
    }

    /**
     * 获取执法单位列表 getOrg.ht
     */
    public void getOrg(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getOrg(getCookie(), requestBody));
    }

    /**
     * 环保督察
     */
    public void environmentSuperviseGet(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.environmentSuperviseGet(getCookie(),requestBody));
    }

    /**
     * 是否收藏  myCollect/isCollection.ht
     */
    public void isCollection(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.isCollection(getCookie(),requestBody));
    }

    /**
     * 是否收藏  myCollect/getMyCollect.ht
     */
    public void getMyCollect(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getMyCollect(getCookie(),requestBody));
    }

    /**
     * 已收藏收藏  myCollect/addCollect.ht
     */
    public void addCollect(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.addCollect(getCookie(),requestBody));
    }

    /**
     * 已收藏收藏  xzapi/caseQuery/queryCaseStep
     */
    public void queryCaseStep(Subscriber<BaseBean> subscriber, String caseId) {
        sub(subscriber, apiService.queryCaseStep(getCookie(),caseId));
    }



    /**
     * 已收藏收藏  myCollect/cancelCollect.ht
     */
    public void cancelCollect(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.cancelCollect(getCookie(),requestBody));
    }

    /**
     * 已收藏收藏  /xzapi/message/getAll
     */
    public void getMessageList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getMessageList(getCookie(),requestBody));
    }

    public void getVersionInfo(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getVersionInfo(getCookie(),requestBody));
    }

    /**
     * 已分派线索列表  zxapi/caseClue/getHaveFenpaiClueList
     */
    public void getHaveFenpaiClueList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getHaveFenpaiClueList(getCookie(),requestBody));
    }

    /**
     * 待分派线索列表 zxapi/caseClue/getClueInfoList
     */
    public void getClueInfoList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getClueInfoList(getCookie(),requestBody));
    }

    /**
     * 案件办理  xzapi/home/feisuCaseData
     */
    public void feisuCaseData(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.feisuCaseData(getCookie(),requestBody));
    }

    /**
     * 监督执行  xzapi/home/supervisePerformData
     */
    public void supervisePerformData(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.supervisePerformData(getCookie(),requestBody));
    }

    /**
     * 接入单位  xzapi/home/jierudanweiData
     */
    public void jierudanweiData(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.jierudanweiData(getCookie(),requestBody));
    }


    /**
     * 调查取证列表
     */
    public void getDiaoChaQuZhengList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getDiaoChaQuZhengList(getCookie(),requestBody));
    }

    /**
     * 消息已读：xzapi/message/updStatus
     * @param subscriber
     * @param requestBody
     */
    public void updStatus(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.updStatus(getCookie(),requestBody));
    }

    /**********案件查询**********/
    /**
     * 行政处罚 xzapi/caseQuery/chufaQuery
     * @param subscriber
     * @param requestBody
     */
    public void chufaQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.chufaQuery(getCookie(),requestBody));
    }
    /**
     * 非诉案件 xzapi/caseQuery/feisuQuery
     * @param subscriber
     * @param requestBody
     */
    public void feisuQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.feisuQuery(getCookie(),requestBody));
    }

    /**
     * 个人相关案件 xzapi/caseQuery/showCaseByXianyiren
     * @param subscriber
     * @param requestBody
     */
    public void showCaseByXianyiren(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.showCaseByXianyiren(getCookie(),requestBody));
    }

    /**
     * 单位相关案件 xzapi/caseQuery/showCaseByCompany
     * @param subscriber
     * @param requestBody
     */
    public void showCaseByCompany(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.showCaseByCompany(getCookie(),requestBody));
    }

    /**
     * 涉案单位 xzapi/caseQuery/companySearch
     * @param subscriber
     * @param requestBody
     */
    public void companySearch(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.companySearch(getCookie(),requestBody));
    }

    /**
     * 涉案单位 xzapi/caseQuery/suspectSearch
     * @param subscriber
     * @param requestBody
     */
    public void suspectSearch(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.suspectSearch(getCookie(),requestBody));
    }
    /**
     * 大数据检索 xzapi/caseQuery/caseList
     * @param subscriber
     * @param requestBody
     */
    public void caseList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.caseList(getCookie(),requestBody));
    }
    /**********案件查询**********/

    /**
     * 大数据检索 xzapi/communication/alreadyReplyList
     * @param subscriber
     * @param requestBody
     */
    public void alreadyReplyList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.alreadyReplyList(getCookie(),requestBody));
    }
    /**
     * 待回复交流 xzapi/communication/noReplyList
     * @param subscriber
     * @param requestBody
     */
    public void noReplyList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.noReplyList(getCookie(),requestBody));
    }

    /**
     * 发送互动交流详情 xzapi/communication/sendDetail
     */
    public void hdlxSendDetail(Subscriber<BaseBean> subscriber, String communionId) {
        sub(subscriber, apiService.hdlxSendDetail(getCookie(),communionId));
    }
    /**
     * 接收互动交流详情 xzapi/communication/receiveDetail
     */
    public void receiveDetail(Subscriber<BaseBean> subscriber, String receiveId) {
        sub(subscriber, apiService.receiveDetail(getCookie(),receiveId));
    }

    /**
     * 获取案件催办列表xzapi/caseWarn/urgeTips
     */
    public void urgeTips(Subscriber<BaseBean> subscriber, String caseId) {
        sub(subscriber, apiService.urgeTips(getCookie(),caseId));
    }

    /**
     * 获取检察建议催办列表xzapi/caseWarn/urgeProposalTips
     */
    public void urgeProposalTips(Subscriber<BaseBean> subscriber, String proposalId) {
        sub(subscriber, apiService.urgeProposalTips(getCookie(),proposalId));
    }



    /**
     * 之鞥你预警超时 xzapi/caseWarn/timeOutCaseList
     */
    public void timeOutCaseList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.timeOutCaseList(getCookie(),requestBody));
    }
    /**
     * 智能预警  金额预警  xzapi/caseWarn/amountList
     */
    public void amountList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.amountList(getCookie(),requestBody));
    }

    /**
     * 智能预警  检察建议超时预警  xzapi/caseWarn/timeOutProposalList
     */
    public void timeOutProposalList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.timeOutProposalList(getCookie(),requestBody));
    }




    /******************检察建议************/
    /**
     * 待回复 xzapi/proposal/notReplyList
     * @param subscriber
     * @param requestBody
     */
    public void notReplyList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.notReplyList(getCookie(),requestBody));
    }

    /**
     * 已发出 xzapi/proposal/sendList
     * @param subscriber
     * @param requestBody
     */
    public void sendList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.sendList(getCookie(),requestBody));
    }

    /**
     * 已核实 xzapi/proposal/verifyList
     * @param subscriber
     * @param requestBody
     */
    public void verifyList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.verifyList(getCookie(),requestBody));
    }

    /**
     * 待核实 xzapi/proposal/waitList
     * @param subscriber
     * @param requestBody
     */
    public void waitList(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.waitList(getCookie(),requestBody));
    }
    /**
     * 检察建议详情 xzapi/proposal/sendDetail
     * @param subscriber
     */
    public void sendDetail(Subscriber<BaseBean> subscriber, String proposalId) {
        sub(subscriber, apiService.sendDetail(getCookie(),proposalId));
    }
    /******************检察建议************/


    /**
     * 检察建议详情  zxapi/caseClue/getClueDetail
     * @param subscriber
     */
    public void getClueDetail(Subscriber<BaseBean> subscriber, String clueId) {
        sub(subscriber, apiService.getClueDetail(getCookie(),clueId));
    }


    /**
     * 获取字典信息 xzapi/system/getDicByKey
     */
    public void getDicByKey(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getDicByKey(getCookie(),requestBody));
    }

    /**
     * 得到区域
     */
    public void getDistrict(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getDistrict(getCookie(),requestBody));
    }

    /**
     * 得到区域
     */
    public void getDistrictTreeData(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getDistrictTreeData(getCookie(),requestBody));
    }

    /**
     * 得到全国区域
     */
    public void getDistrictAll(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getDistrictAll(getCookie(),requestBody));
    }

    /**
     * 获取详情 POST /webapi/ourClue/ourClueGet.ht
     */
    public void ourClueGet(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.ourClueGet(getCookie(),requestBody));
    }

    /**
     * 获取详情 POST /webapi/sysFile/delEvidenceMaterial.ht
     */
    public void delEvidenceMaterial(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.delEvidenceMaterial(getCookie(),requestBody));
    }

    /**
     * 结束调查 POST ourClue/finishSurvey.ht
     */
    public void finishSurvey(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.finishSurvey(getCookie(),requestBody));
    }

    /**
     * 材料要求 POST /webapi/ourClue/getEvidenceDemand.ht
     */
    public void getEvidenceDemand(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getEvidenceDemand(getCookie(),requestBody));
    }

    /**
     * 获取线索信息 caseSource/getCaseByJudgeId.ht
     */
    public void getCaseByJudgeId(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.getCaseByJudgeId(getCookie(),requestBody));
    }


    /**
     * 分派列表 getAssignClueOrg
     */
    public void getAssignClueOrg(Subscriber<BaseBean> subscriber, int page, String clueId) {
        sub(subscriber, apiService.getAssignClueOrg(getCookie(),page,clueId));
    }

    /**
     * 分派 zxapi/caseClue/clueFenpai
     */
    public void clueFenpai(Subscriber<BaseBean> subscriber, String receiveOrg, String clueId) {
        sub(subscriber, apiService.clueFenpai(getCookie(),receiveOrg,clueId));
    }


    /**
     * 案例库 xzapi/caseLib/searchCaseLib
     * @param subscriber
     * @param requestBody
     */
    public void searchCaseLib(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.searchCaseLib(getCookie(),requestBody));
    }

    /**
     * @param subscriber
     * @param observable
     */
    private void sub(Subscriber<BaseBean> subscriber, Observable observable) {
        observable.subscribeOn(Schedulers.io())
                .unsubscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(subscriber);
    }

    /**
     * 请求地址：/registerMember.client
     *
     * @param subscriber
     * @param requestBody 注册
     */
    public void register(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
//        sub(subscriber, apiService.login(getCookie(),requestBody));
    }

    /**
     * 获取用户信息POST xzapi/appUser/detail
     */
    public void getUser(Subscriber<BaseBean> subscriber) {
        sub(subscriber, apiService.getUser(getCookie()));
    }

    /**
     * 获取用户信息POST xzapi/appUser/edit
     */
    public void updateUser(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.updateUser(getCookie(), requestBody));
    }
    /**
     * 根据用户id获取区划GET xzapi/caseLib/getAreaList
     */
    public void getAreaList(Subscriber<BaseBean> subscriber) {
        sub(subscriber, apiService.getAreaList(getCookie()));
    }

    /**
     * 获取地区划 GET xzapi/system/getDistrictByJb
     */
    public void getDistrictByJb(Subscriber<BaseBean> subscriber) {
        sub(subscriber, apiService.getDistrictByJb(getCookie()));
    }

    /**
     * 接收单位 GET xzapi/system/getRecOrgTree
     */
    public void getRecOrgTree(Subscriber<BaseBean> subscriber) {
        sub(subscriber, apiService.getRecOrgTree(getCookie()));
    }



    /**
     * 根据用户id获取区划GET xzapi/system/getOrgTreeData
     */
    public void getOrgTreeData(Subscriber<BaseBean> subscriber) {
        sub(subscriber, apiService.getOrgTreeData(getCookie()));
    }



    /**************流程监督环节开始******************/
    /**
     * 行政受理 xzapi/caseSupervision/acceptCaseQuery
     */
    public void acceptCaseQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.acceptCaseQuery(getCookie(), requestBody));
    }
    /**
     * 裁定同意撤回强制执行申请案件列表 xzapi/caseSupervision/agreeUndoEnforceQuery
     */
    public void agreeUndoEnforceQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.agreeUndoEnforceQuery(getCookie(), requestBody));
    }
    /**
     * 申请强制执行案件列表
     */
    public void applyEnforceQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.applyEnforceQuery(getCookie(), requestBody));
    }

    /**
     * 法院立案案件列表
     * @param subscriber
     * @param requestBody
     */
    public void courtLianQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.courtLianQuery(getCookie(), requestBody));
    }
    /**
     * 法院不予立案案件列表
     * @param subscriber
     * @param requestBody
     */
    public void courtNoLianQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.courtNoLianQuery(getCookie(), requestBody));
    }
    /**
     * 催告案件列表
     * @param subscriber
     * @param requestBody
     */
    public void cuiGaoQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.cuiGaoQuery(getCookie(), requestBody));
    }
    /**
     * 法院受理案件列表
     * @param subscriber
     * @param requestBody
     */
    public void determineAcceptQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.determineAcceptQuery(getCookie(), requestBody));
    }
    /**
     * 裁定准予执行案件列表
     * @param subscriber
     * @param requestBody
     */
    public void enforceQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.enforceQuery(getCookie(), requestBody));
    }
    /**
     * 执行完毕案件列表
     * @param subscriber
     * @param requestBody
     */
    public void executionFinishedQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.executionFinishedQuery(getCookie(), requestBody));
    }
    /**
     * 终结执行案件列表
     * @param subscriber
     * @param requestBody
     */
    public void executionTerminatedQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.executionTerminatedQuery(getCookie(), requestBody));
    }
    /**
     * 结案案件列表
     * @param subscriber
     * @param requestBody
     */
    public void jieanQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.jieanQuery(getCookie(), requestBody));
    }
    /**
     * 裁定不予执行案件列表
     * @param subscriber
     * @param requestBody
     */
    public void noPerformQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.noPerformQuery(getCookie(), requestBody));
    }
    /**
     * 法院不予受理案件列表
     * @param subscriber
     * @param requestBody
     */
    public void refuseAcceptQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.refuseAcceptQuery(getCookie(), requestBody));
    }
    /**
     * 行政撤案案件列表
     * @param subscriber
     * @param requestBody
     */
    public void returnCaseQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.returnCaseQuery(getCookie(), requestBody));
    }
    /**
     * 裁定终结本次执行案件列表
     * @param subscriber
     * @param requestBody
     */
    public void terminationPerformQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.terminationPerformQuery(getCookie(), requestBody));
    }
    /**
     * 撤销强制执行案件列表
     * @param subscriber
     * @param requestBody
     */
    public void undoEnforceQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.undoEnforceQuery(getCookie(), requestBody));
    }
    /**
     * 行政处罚案件列表
     * @param subscriber
     * @param requestBody
     */
    public void xingzhengChufaQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.xingzhengChufaQuery(getCookie(), requestBody));
    }
    /**
     * 行政复议案件列表
     * @param subscriber
     * @param requestBody
     */
    public void xingzhengFuYiQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.xingzhengFuYiQuery(getCookie(), requestBody));
    }
    /**
     * 行政立案案件列表
     * @param subscriber
     * @param requestBody
     */
    public void xingzhengLianQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.xingzhengLianQuery(getCookie(), requestBody));
    }
    /**
     * 行政不立案案件列表
     * @param subscriber
     * @param requestBody
     */
    public void xingzhengNoLianQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.xingzhengNoLianQuery(getCookie(), requestBody));
    }
    /**
     * 行政执行案件列表
     * @param subscriber
     * @param requestBody
     */
    public void xingzhengPerformQuery(Subscriber<BaseBean> subscriber, RequestBody requestBody) {
        sub(subscriber, apiService.xingzhengPerformQuery(getCookie(), requestBody));
    }
    /**************流程监督环节结束******************/





    //在访问HttpMethods时创建单例
    private static class SingletonHolder {
        private static final HttpMethods INSTANCE = new HttpMethods();
    }
}
